package com.plan.car.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotEmpty;
import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("ictprogram")
public class Item {
    @TableId(value = "item_id",type = IdType.AUTO)
    private Long projectId;

    @NotEmpty(message = "项目名称不为空")
    private String name;

    @NotEmpty(message = "项目负责人工号不为空")
    private String username;

    @TableField(value = "start_time")
    @NotEmpty(message = "项目开始时间不为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;

    @TableField(value = "end_time")
    @NotEmpty(message = "项目结束时间不为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;

    @TableField(value = "business_type")
    @NotEmpty(message = "项目类型不为空")
    private String businessType;

    @TableField(value = "business_number")
    @NotEmpty(message = "项目编号不为空")
    private String businessNumber;

    @TableField(value = "dept_id")
    @NotEmpty(message = "部门不为空")
    private Long deptId;

    @TableField(value = "create_by")
    private Long createBy;

    @TableField(value = "create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @TableField(value = "update_by")
    private Long updateBy;

    @TableField(value = "update_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
}
